package cc.ailley.observer;

import cc.ailley.observer.entity.WechatObserver;
import cc.ailley.observer.event.SubscribeEvent;
import cc.ailley.observer.subject.WexinSubject;

public class Test {

    public static void main(String[] args) {
        WexinSubject wexinSubject = new WexinSubject();

        WechatObserver wechatObserver = new PlayObserverImpl();
        WechatObserver wechatObserver1 = new PlayObserverImpl();
        WechatObserver wechatObserver2 = new PlayObserverImpl();

        wexinSubject.attach(wechatObserver);
        wexinSubject.attach(wechatObserver1);
        wexinSubject.attach(wechatObserver2);
        wexinSubject.notify(new SubscribeEvent("游戏", "吃鸡更新了～"));

        wexinSubject.detach(wechatObserver2);
        wexinSubject.notify(new SubscribeEvent("游戏", "LOL更新了～"));
    }
}
